package com.yiyang.entity;


import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

//实体类也可以叫POJO
@Data
@TableName("building")
@Schema(name = "Building",description = "楼宇实体类")
public class Building {
    @TableId(type = IdType.AUTO)
    @Schema(name = "id",description = "楼宇id")
    private Integer id;
    @Schema(name = "name",description = "楼宇名字")
    @TableField("name")
    private String name;
    @Schema(name = "height",description = "楼宇层数")
    private Integer height;
    //表示用来完成逻辑删除
    @TableLogic
    @Schema(name = "isDelete",description = "数据库逻辑删除")
    private Integer isDelete;
    //日期时间格式化
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(name = "createTime",description = "楼宇创建时间")
    private Date createTime;
    //表述当前的这个属性不需要与表中的字段进行对应
    @TableField(exist = false)
    private String desc;
}
